package com.cl.short_video_java.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import lombok.Data;

/**
 * @TableName sys_mail_log
 */
@TableName(value = "sys_mail_log")
@Data
public class SysMailLog implements Serializable {
	/**
	 * 邮件日志
	 */
	@TableId(type = IdType.AUTO)
	private Integer id;

	/**
	 * 主题
	 */
	private String subject;

	/**
	 * 内容
	 */
	private String content;

	/**
	 *
	 */
	private LocalDateTime createTime;

	/**
	 * 接收账号
	 */
	private Integer userId;

	/**
	 * 发送人邮箱
	 */
	private String sendMail;

	/**
	 * 接收邮箱
	 */
	private String receptionMail;
	/**
	 *接收电话
	 */
	private String phone;

	/**
	 * 无用字段，作为转换用
	 */
	private Date time;

	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		SysMailLog other = (SysMailLog) that;
		return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
				&& (this.getSubject() == null ? other.getSubject() == null : this.getSubject().equals(other.getSubject()))
				&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
				&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
				&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
				&& (this.getSendMail() == null ? other.getSendMail() == null : this.getSendMail().equals(other.getSendMail()))
				&& (this.getReceptionMail() == null ? other.getReceptionMail() == null : this.getReceptionMail().equals(other.getReceptionMail()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime * result + ((getSubject() == null) ? 0 : getSubject().hashCode());
		result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
		result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
		result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
		result = prime * result + ((getSendMail() == null) ? 0 : getSendMail().hashCode());
		result = prime * result + ((getReceptionMail() == null) ? 0 : getReceptionMail().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", id=").append(id);
		sb.append(", subject=").append(subject);
		sb.append(", content=").append(content);
		sb.append(", createTime=").append(createTime);
		sb.append(", userId=").append(userId);
		sb.append(", sendMail=").append(sendMail);
		sb.append(", receptionMail=").append(receptionMail);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}
}